//package com.fsg.user.service.impl;
//
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Service;
//import org.springframework.transaction.annotation.Transactional;
//
//import com.fsg.user.entity.EsVendor;
//import com.fsg.user.mapper.elastic.EsVendorDao;
//import com.fsg.user.service.EsVendorService;
//
//
///**
// * @author lfanzhi
// */
//@Service
//@Transactional
//@Slf4j
//public class EsVendorServiceImpl implements EsVendorService {
//
////    /**
////     * 可选
////     */
////    @Autowired(required = false)
////    private EsVendorDao vendorDao;
////
////    @Override
////    public EsVendor saveVendor(EsVendor EsVendor) {
////
////        return vendorDao.save(EsVendor);
////    }
////
////    @Override
////    public void deleteVendor(String id) {
////
////        vendorDao.deleteById(id);
////    }
////
////    @Override
////    public void deleteAll() {
////
////        vendorDao.deleteAll();
////    }
//    
//  
//
////    @Override
////    public Page<EsVendor> findByCondition(Integer type, String key, SearchVo searchVo, Pageable pageable) {
////    	EsVendor esVendor =vendorDao.findById(key).get();
////    	log.info(JSON.(esVendor));
//    	
//    	//QueryBuilder qb =new ;
//
////        if (type == null && StrUtil.isBlank(key) && StrUtil.isBlank(searchVo.getStartDate())) {
////            // 无过滤条件获取全部
////            return vendorDao.findAll(pageable);
////        } else if (type != null && StrUtil.isBlank(key) && StrUtil.isBlank(searchVo.getStartDate())) {
////            // 仅有type
////            return vendorDao.findByLogType(type, pageable);
////        }
////
////        QueryBuilder qb;
////
////        QueryBuilder qb0 = QueryBuilders.termQuery("logType", type);
////        QueryBuilder qb1 = QueryBuilders.multiMatchQuery(key, "name", "requestUrl", "requestType", "requestParam", "username", "ip", "ipInfo");
////        // 在有type条件下
////        if (StrUtil.isNotBlank(key) && StrUtil.isBlank(searchVo.getStartDate()) && StrUtil.isBlank(searchVo.getEndDate())) {
////            // 仅有key
////            qb = QueryBuilders.boolQuery().must(qb0).must(qb1);
////        } else if (StrUtil.isBlank(key) && StrUtil.isNotBlank(searchVo.getStartDate()) && StrUtil.isNotBlank(searchVo.getEndDate())) {
////            // 仅有时间范围
////            Long start = DateUtil.parse(searchVo.getStartDate()).getTime();
////            Long end = DateUtil.endOfDay(DateUtil.parse(searchVo.getEndDate())).getTime();
////            QueryBuilder qb2 = QueryBuilders.rangeQuery("timeMillis").gte(start).lte(end);
////            qb = QueryBuilders.boolQuery().must(qb0).must(qb2);
////        } else {
////            // 两者都有
////            Long start = DateUtil.parse(searchVo.getStartDate()).getTime();
////            Long end = DateUtil.endOfDay(DateUtil.parse(searchVo.getEndDate())).getTime();
////            QueryBuilder qb2 = QueryBuilders.rangeQuery("timeMillis").gte(start).lte(end);
////            qb = QueryBuilders.boolQuery().must(qb0).must(qb1).must(qb2);
////        }
//    	//vendorDao.search(qb, pageable)
//        // 多字段搜索
////        return  null  ;
////    }
//
//	
//}
